-- regular_damage
-- create by xinj
-- 固定伤害（技能规则）

return {
    apply = function(source, target, skillId, round, para, extra)
        -- 攻击方的攻击
        local attack = source:getAttack();

        -- 被对方百分比削弱
        local prop = PropM.combine(target, "weak_enemy", "attack");
        attack = PropM.apply(prop, attack);

        -- 被对方绝对值削弱
        prop = PropM.combine(target, "weak_enemy2", "attack");
        attack = PropM.apply(prop, attack);

        -- 威力
        local force = para;
        -- 伤害
        local damage = math.modf(force * attack / 1000);

        -- 增加命中动作
        SkillM.getSequence(target):hit(source, target, skillId);
        -- 伤害
        CombatM.doDamage(source, target, damage, skillId, nil, extra);

        -- 作用目标
        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return tonumber(arr[1]);
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        -- 威力
        local damage = para;

        desc = string.gsub(desc, "{regular_damage}", damage);

        return desc;
    end,
};
